# 优先级：order=0 > order=正数 > 无order > order=负数


import pytest


class Test01:

    def test_d(self):
        print("---test_d")

    @pytest.mark.run(order=-3)
    def test_c(self):
        print("---test_c")

    @pytest.mark.run(order=0)
    def test_b(self):
        print("---test_b")

    @pytest.mark.run(order=1)
    def test_a(self):
        print("---test_a")

if __name__ == '__main__':
    pytest.main()

# 执行结果
# test02_优先级顺序.py::Test01::test_b PASSED                              [ 25%]---test_b
#
# test02_优先级顺序.py::Test01::test_a PASSED                              [ 50%]---test_a
#
# test02_优先级顺序.py::Test01::test_d PASSED                              [ 75%]---test_d
#
# test02_优先级顺序.py::Test01::test_c PASSED                              [100%]---test_c